import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    port: 8080, // 服务端口号
    open: true, // 服务启动时是否自动打开浏览器
    cors: true, // 允许跨域
    host: "0.0.0.0",
    proxy: {
      "/cc": {
        target: "http://10.160.96.137/cdc-softphone", //代理接口
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/cc/, ""),
      },
      "/bb": {
        target: "http://139.196.11.162:5360", //代理接口
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/cc/, ""),
      },
      "/aa": {
        target: "https://sh-gws.csvw.com:8090", //代理接口
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/aa/, ""),
      },
    },
  },
});
